package ma.ac.onousc.gestionfi.budget.model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;

/**
 * The persistent class for the personnel database table.
 * 
 */
@Entity
@NamedQueries({
		@NamedQuery(name = "Personnel.authentifier", query = "select o from Personnel o where o.loginPersonnel = :LOGIN and o.pwdPersonnel = :PWD"),
		@NamedQuery(name = "Personnel.findAll", query = "select o from Personnel o order by o.nomPersonnel"),	
		@NamedQuery(name = "Personnel.findByLogin", query = "select o from Personnel o where o.loginPersonnel = :LOGIN"),
		@NamedQuery(name = "Personnel.findByEtb", query = "select o from Personnel o where o.etablissement.idEtablissement = :ID") })
public class Personnel implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID_PERSONNEL")
	private int idPersonnel;

	@Column(name = "CIN_PERSONNEL")
	private String cinPersonnel;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DATE_NAISSANCE_PERSONNEL")
	private Date dateNaissancePersonnel;

	@Column(name = "EMAIL_PERSONNEL")
	private String emailPersonnel;

	@Column(name = "FONCTION_PERSONNEL")
	private String fonctionPersonnel;

	@Column(name = "LOGIN_PERSONNEL")
	private String loginPersonnel;

	@Column(name = "MATRICULE_PERSONNEL")
	private String matriculePersonnel;

	@Column(name = "NOM_PERSONNEL")
	private String nomPersonnel;

	@Column(name = "PRENOM_PERSONNEL")
	private String prenomPersonnel;

	@Column(name = "PWD_PERSONNEL")
	private String pwdPersonnel;

	@Column(name = "SERVICE_PERSONNEL")
	private String servicePersonnel;

	@Column(name = "TELEPHONE_PERSONNEL")
	private String telephonePersonnel;

	// bi-directional many-to-one association to Etablissement
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "ID_ETABLISSEMENT")
	private Etablissement etablissement;

	// bi-directional many-to-one association to Soumettre
	@OneToMany(mappedBy = "personnel", fetch = FetchType.LAZY)
	private Set<Soumettre> soumettres;

	public Personnel() {
	}
	
	

	public Personnel(String cinPersonnel, Date dateNaissancePersonnel,
			String emailPersonnel, String fonctionPersonnel,
			String loginPersonnel, String matriculePersonnel,
			String nomPersonnel, String prenomPersonnel, String pwdPersonnel,
			String servicePersonnel, String telephonePersonnel) {
		super();
		this.cinPersonnel = cinPersonnel;
		this.dateNaissancePersonnel = dateNaissancePersonnel;
		this.emailPersonnel = emailPersonnel;
		this.fonctionPersonnel = fonctionPersonnel;
		this.loginPersonnel = loginPersonnel;
		this.matriculePersonnel = matriculePersonnel;
		this.nomPersonnel = nomPersonnel;
		this.prenomPersonnel = prenomPersonnel;
		this.pwdPersonnel = pwdPersonnel;
		this.servicePersonnel = servicePersonnel;
		this.telephonePersonnel = telephonePersonnel;
	}



	public int getIdPersonnel() {
		return this.idPersonnel;
	}

	public void setIdPersonnel(int idPersonnel) {
		this.idPersonnel = idPersonnel;
	}

	public String getCinPersonnel() {
		return this.cinPersonnel;
	}

	public void setCinPersonnel(String cinPersonnel) {
		this.cinPersonnel = cinPersonnel;
	}

	public Date getDateNaissancePersonnel() {
		return this.dateNaissancePersonnel;
	}

	public void setDateNaissancePersonnel(Date dateNaissancePersonnel) {
		this.dateNaissancePersonnel = dateNaissancePersonnel;
	}

	public String getEmailPersonnel() {
		return this.emailPersonnel;
	}

	public void setEmailPersonnel(String emailPersonnel) {
		this.emailPersonnel = emailPersonnel;
	}

	public String getFonctionPersonnel() {
		return this.fonctionPersonnel;
	}

	public void setFonctionPersonnel(String fonctionPersonnel) {
		this.fonctionPersonnel = fonctionPersonnel;
	}

	public String getLoginPersonnel() {
		return this.loginPersonnel;
	}

	public void setLoginPersonnel(String loginPersonnel) {
		this.loginPersonnel = loginPersonnel;
	}

	public String getMatriculePersonnel() {
		return this.matriculePersonnel;
	}

	public void setMatriculePersonnel(String matriculePersonnel) {
		this.matriculePersonnel = matriculePersonnel;
	}

	public String getNomPersonnel() {
		return this.nomPersonnel;
	}

	public void setNomPersonnel(String nomPersonnel) {
		this.nomPersonnel = nomPersonnel;
	}

	public String getPrenomPersonnel() {
		return this.prenomPersonnel;
	}

	public void setPrenomPersonnel(String prenomPersonnel) {
		this.prenomPersonnel = prenomPersonnel;
	}

	public String getPwdPersonnel() {
		return this.pwdPersonnel;
	}

	public void setPwdPersonnel(String pwdPersonnel) {
		this.pwdPersonnel = pwdPersonnel;
	}

	public String getServicePersonnel() {
		return this.servicePersonnel;
	}

	public void setServicePersonnel(String servicePersonnel) {
		this.servicePersonnel = servicePersonnel;
	}

	public String getTelephonePersonnel() {
		return this.telephonePersonnel;
	}

	public void setTelephonePersonnel(String telephonePersonnel) {
		this.telephonePersonnel = telephonePersonnel;
	}

	public Etablissement getEtablissement() {
		return this.etablissement;
	}

	public void setEtablissement(Etablissement etablissement) {
		this.etablissement = etablissement;
	}

	public Set<Soumettre> getSoumettres() {
		return this.soumettres;
	}

	public void setSoumettres(Set<Soumettre> soumettres) {
		this.soumettres = soumettres;
	}

}